package org.balthie.demo.sum.misc.direct;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.concurrent.TimeUnit;

public class URLClassPathResourcePrinter
{
    public static void main(String[] args) throws InterruptedException
    {
        new URLClassPathResourcePrinter();
    }
    
    public URLClassPathResourcePrinter() throws InterruptedException
    {
        System.out.println("start");
        
        URLClassLoader acl = (URLClassLoader) URLClassPathResourcePrinter.class.getClassLoader();
        System.out.println(acl);
        
        for(int i = 0; i < acl.getURLs().length; i++)
        {
            System.out.println(i + "  :  "+acl.getURLs()[i].getPath());
            if(i == acl.getURLs().length-1)
            {
                System.out.println(i + "  :  "+acl.getURLs()[i].getPath());
            }
        }
        URL url = acl.getResource("org.eclipse.jdt.launching.internal.javaagent.Premain");
        System.out.println(url);
        
        TimeUnit.DAYS.sleep(1L);
        System.out.println("end");
    }
}
